﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using ajax = AjaxEngines;

namespace AjaxEngines
{
    [Serializable]
    public class PageStatePersisterFactory
    {
        public static PageStatePersister CreatePageStatePersister(Page page, PageStatePersisterType statetype)
        {
            switch (statetype)
            {
                case PageStatePersisterType.Session:
                    return new ajax.SessionPageStatePersister(page);
                case PageStatePersisterType.HiddenFiled:
                    return new ajax.HiddenFieldPageStatePersister(page);
                case PageStatePersisterType.File:
                    return new ajax.FilePageStatePersister(page);
                case PageStatePersisterType.Cache:
                    return new ajax.CachePageStatePersister(page);
                default:
                    return new ajax.SessionPageStatePersister(page);
            }
        }

    }
}
